package com.shxc.smarttrade.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.shxc.smarttrade.R;
import com.shxc.smarttrade.utils.AppUtils;


/**
 * 强制更新
 */
public class UpdateForceDialog extends Dialog {

    public View view;
    private Context c;
    private TextView content_textview;
    private TextView submit_textview;

    public UpdateForceDialog(Context paramContext, int paramInt) {
        super(paramContext, paramInt);
        view = View.inflate(paramContext, R.layout.dialog_update_force, null);
        this.setContentView(view);
        this.c = paramContext;
        content_textview = findViewById(R.id.content_textview);
        submit_textview = findViewById(R.id.submit_textview);
    }

    /**
     * 显示弹出框
     */
    public void showDialog(String content) {

        if (!AppUtils.isEmpty(content)) {
            content_textview.setText(content);
        }else{
            content_textview.setText("修复了一些bug");
        }

        this.show();
    }

    public void cancel() {
        if (!isShowing())
            return;
        super.cancel();
    }

    public void show() {
        if (isShowing())
            return;
        super.show();
    }

    public TextView getSubmit_textview() {
        return submit_textview;
    }
}
